package dr.member.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import dr.controller.ActionSupportLogin;
import dr.member.dao.MemberDAO;
import dr.member.domain.Member;

public class ModifyFormAction extends ActionSupportLogin {

	@Override
	public String execute(HttpServletRequest request,
			HttpServletResponse response) throws Throwable {
		
		String id=getUserLoginId(request);// session
		
		//login check
		if(id==null) return LOGINULL_PATH;
		//login check
		
		MemberDAO manager = MemberDAO.getInstance();
		Member member=manager.getMember(id);
		
		String[] phone = member.getPhone().split("-");
		request.setAttribute("phone1", phone[0]);
		request.setAttribute("phone2", phone[1]);
		request.setAttribute("phone3", phone[2]);
		request.setAttribute("member",member);
		
		return "/member/modifyForm.jsp";
	}

}
